package NC63_扑克牌顺子;

import java.util.Arrays;

public class Solution {
    public boolean IsContinuous(int[] numbers){

        Arrays.sort(numbers);
        int zero_numbers = 0;
        for (Integer e : numbers){
            if (e == 0){
                zero_numbers++;
            }
        }
        int gap = 0;

        for (int i = zero_numbers - 1; i < numbers.length - 1; i++){
            if (numbers[i] == numbers[i + 1]){
                return false;
            }
            gap += numbers[i + 1] - numbers[i] - 1;
        }

        return gap <= zero_numbers;
    }
}
